package voldTransfo;


import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import uml2Java.JavaChargeur;
import astjava.Model;

public class TestJavaChargeur {
	
	private JavaChargeur _chargeur;
	
	private String _path;
	
	@Before
	public void setUp() throws Exception {
		_path = "modele_de_test/test.astjava";
		_chargeur = new JavaChargeur(_path);
	}

	@Test
	public void testLoadResource() {
		assertNotNull(_chargeur.loadResource());
	}

	@Test
	public void testLoadJavaModel() {
		assertTrue(_chargeur.loadJavaModel() instanceof Model);
	}

	@Test
	public void testLoadPackageRacine() {
		assertEquals(_chargeur.loadJavaModel().getName(), "testChargement");
	}

	@After
	public void tearDown() throws Exception {
		_chargeur = null;
	}
}